package demoMod.nanaki.audio;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.Interpolation;
import com.megacrit.cardcrawl.audio.SoundInfo;

public class MySoundInfo extends SoundInfo {
    private float fadeDuration = 1.0F;

    public MySoundInfo(String name, long id) {
        super(name, id);
    }

    public void update() {
        if (this.fadeDuration != 0.0F) {
            this.fadeDuration -= Gdx.graphics.getDeltaTime();
            this.volumeMultiplier = Interpolation.fade.apply(1.0F, 0.0F, 1.0F - this.fadeDuration);
            if (this.fadeDuration < 0.0F) {
                this.isDone = true;
                this.fadeDuration = 0.0F;
            }
        }
    }
}
